<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Building Delete</title>
</head>

<body>

<h1>UNO Course Scheduler - Delete Buildings</h1>

<?php
//get num_rows currently in buildings table
$building_name = $_GET['id'];

//initialize variables used to connect to database
$db = "scheduler";
$user = "root";
$pass = "";

//connect to database
mysql_connect("localhost", $user, $pass);
@mysql_select_db($db);

$query = "DELETE FROM buildings WHERE building_name='$building_name'";
$result = mysql_query($query);

if ($result)
{
	echo "<b>$building_name</b> has been successfully deleted!";
	echo "<br />";
}

//close
mysql_close();

?>

<p>
	<a href="index.php">&lt;&lt; Back to Buildings Portal</a><br />
</p>

</body>
</html>